home *** CD-ROM | disk | FTP | other *** search
/ Champak 138 / Volume 138 Aug 19 2011 - Damaged.iso / Games / shore_siege.swf / scripts / DefineSprite_244_Upgrader / frame_1 / DoAction.as
Text File  |  2011-08-19  |  2KB  |  102 lines

  1. function onEnterFrame()
  2. {
  3.    dTimer--;
  4.    if(dTimer == 0)
  5.    {
  6.       dTimer = 30;
  7.       _parent.mouseMC.swapDepths(_parent.getNextHighestDepth() + 20);
  8.    }
  9.    _parent.mouseMC.gotoAndStop(1);
  10.    SHIP.gotoAndStop(_root.shipRepair);
  11.    _parent.SHIP.gotoAndStop(_root.shipRepair);
  12.    SHIP.cannon._visible = _parent.SHIP.cannon._visible;
  13.    repairsLeft = 11 - _root.shipRepair + " REPAIRS";
  14.    covers();
  15. }
  16. function covers()
  17. {
  18.    if(cover_BP._x > 0)
  19.    {
  20.       cover_BP._x -= 10000;
  21.    }
  22.    cover_BP.stop();
  23.    if(cover_UP._x > 0)
  24.    {
  25.       cover_UP._x -= 10000;
  26.    }
  27.    cover_UP.stop();
  28.    if(cover_RT._x > 0)
  29.    {
  30.       cover_RT._x -= 10000;
  31.    }
  32.    cover_RT.stop();
  33.    if(cover_RA._x > 0)
  34.    {
  35.       cover_RA._x -= 10000;
  36.    }
  37.    cover_RA.stop();
  38.    if(cover_UN._x > 0)
  39.    {
  40.       cover_UN._x -= 10000;
  41.    }
  42.    cover_UN.stop();
  43.    if(cover_UF._x > 0)
  44.    {
  45.       cover_UF._x -= 10000;
  46.    }
  47.    cover_UF.stop();
  48.    if(cover_UD._x > 0)
  49.    {
  50.       cover_UD._x -= 10000;
  51.    }
  52.    cover_UD.stop();
  53.    if(cover_HM._x > 0)
  54.    {
  55.       cover_HM._x -= 10000;
  56.    }
  57.    cover_HM.stop();
  58.    if(cover_RS._x > 0)
  59.    {
  60.       cover_RS._x -= 10000;
  61.    }
  62.    cover_RS.stop();
  63.    if(_root.money < 4000 || _root.pirateActive > 3)
  64.    {
  65.       cover_BP._x += 10000;
  66.    }
  67.    if(_root.money < 1000 || _root.pirateTrain > 90 || _root.pirateActive == 0)
  68.    {
  69.       cover_UP._x += 10000;
  70.    }
  71.    if(_root.money < 2000 || _root.turretActive == true)
  72.    {
  73.       cover_RT._x += 10000;
  74.    }
  75.    if(_root.money < 2000 || SHIP.cannon._visible == true)
  76.    {
  77.       cover_RA._x += 10000;
  78.    }
  79.    if(_root.money < 4000 || _root.nailUpgrade == 2)
  80.    {
  81.       cover_UN._x += 10000;
  82.    }
  83.    if(_root.money < 2000 || _root.dropUpgrade == 0 || _root.dropUpgrade == 2)
  84.    {
  85.       cover_UD._x += 10000;
  86.    }
  87.    if(_root.money < 2000 || _root.flameUpgrade == 0 || _root.flameUpgrade == 2)
  88.    {
  89.       cover_UF._x += 10000;
  90.    }
  91.    if(_root.money < 1000 || _root.maxHealth > 190)
  92.    {
  93.       cover_HM._x += 10000;
  94.    }
  95.    if(_root.money < 5000)
  96.    {
  97.       cover_RS._x += 10000;
  98.    }
  99. }
  100. stop();
  101. dTimer = 30;
  102.